package com.cloud.rou.im.core.util;

/**
 * <p></p>
 *
 * @author GaoShuangWen
 * @since 2019-10-30 13:50
 */
public class ObjectNullUtil {
    public static <T> T notNull(T object, String errorMsg) throws NullPointerException {
        if (object == null) {
            throw new NullPointerException(errorMsg);
        } else {
            return object;
        }
    }

    public static <T> T notNull(T object) throws NullPointerException {
        return notNull(object, "[Object null check failed] - this argument is required; it must not be null");
    }
}
